package com.peko.controller;

import com.peko.entity.Product;
import com.peko.feignclient.ProductFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：Peko
 * @Description：TODO
 * @Date：Created in 16:44 2023/7/31
 */

@RestController
public class CategoryController {

    private static final Logger log = LoggerFactory.getLogger(CategoryController.class);

    @Autowired
    private ProductFeignClient productFeignClient;

    @GetMapping("category")
    public String category(){
        log.info("进入种类服务");
        String product = productFeignClient.product();
        log.info("调用productFeignClient：{}",product);

        String result1 = productFeignClient.test("jack", 100);
        log.info("调用productFeignClient.test1：{}",result1);

        String result2 = productFeignClient.test1("jack", 100);
        log.info("调用productFeignClient.test2：{}",result2);

        String result3 = productFeignClient.test2(new Product(1000,"name"));
        log.info("调用productFeignClient.test3：{}",result2);
        return "category ok";
    }
}
